<template>
  <view class="demo-container">
    <view class="demo-header">案例</view>
    <view class="demo-list">
      <navigator 
        url="/pages/index/index"
        class="demo-item"
      >
        初始页面index
      </navigator>
      <navigator 
        url="/pages/tabBar/tabcompage/login/login" 
        class="demo-item"
      >
        登录注册页
      </navigator>
      <view 
        class="demo-item" 
        @click="toCityExplore"
      >
        城市探索
      </view>
      <navigator
        url="/pages/cardViewPage/cardViewPage" 
        class="demo-item"
      >
        新闻卡片
      </navigator>

      <view 
        class="demo-item" 
        @click="toComponentValue"
      >
        组件传值
      </view>
    </view>
  </view>
</template>

<script>
export default {
  methods: {
    toCityExplore() {
      uni.navigateTo({
        url: '/pages/tabBar/demos/city-explore/index'
      });
    },
    toComponentValue() {
      uni.navigateTo({
        url: '/pages/index/IntentPage/IntentPage'
      });
    }
  }
};
</script>

<style scoped>
.demo-container {
  padding: 15px;
}
.demo-header {
  font-size: 20px;
  font-weight: bold;
  text-align: center;
  margin-bottom: 20px;
}
.demo-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.demo-item {
  background-color: #fff;
  border: 1px solid #eee;
  border-radius: 6px;
  padding: 12px 15px;
  text-align: center;
  color: #333;
  transition: all 0.2s;
}
.demo-item:active {
  background-color: #f5f5f5;
}
</style>